const http = require("http")
http.createServer((req,resp) => {
    resp.writeHead(200,{"Content-Type":"application/json;charset=utf8"})
    let studs =  [{
        "sid": 1001, "sname": "张三", "sex": "男", "age": 20, "addr": "上海 ","cid":1
    }, {
        "sid": 1002, "sname": "李四", "sex": "女", "age": 19, "addr": "杭州 ","cid":2
    }, {
        "sid": 1003, "sname": "王五", "sex": "男", "age": 22, "addr": "珠海","cid":3
    }, {
        "sid": 1004, "sname": "小明", "sex": "女", "age": 18, "addr": "广州","cid":2
    }]
    let stud_info = JSON.stringify(studs)
    resp.end(stud_info)
}).listen(8000)
console.log('Server running at http://127.0.0.1:8000/')
